package com.itheima.reggie.mapper;

import com.itheima.reggie.dto.DishDto;
import com.itheima.reggie.entity.DishFlavor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Mapper
public interface DishFlavorMapper {

    void saveBatch(@Param("dishFlavorList") List<DishFlavor> dishFlavorList);

    @Select("select * from  dish_flavor where dish_id = #{dish}")
    List<DishFlavor> findByDishId(Long id);

    @Delete("delete from dish_flavor where dish_id = #{dish}")
    void deleteById(Long id);

    void deleteByDishIds(@Param("ids") List<Long> ids);

    void updateByDishIds(@Param("ids") List<Long> ids, @Param("dishFlavor") DishFlavor dishFlavor);
}
